﻿$(document).ready(function() {
    // create the loading window and set autoOpen to false
    $("#loadingScreen").dialog({
        autoOpen: false, // set this to false so we can manually open it
        closeOnEscape: false,
        dialogClass: "loadingScreenWindow",
        draggable: false,
        minWidth: 42,
        width: 'auto',
        height: 40,
        modal: true,
        buttons: {},
        resizable: false,
        open: function() {
            // scrollbar fix for IE
            //$('body').css('overflow', 'hidden');
        },
        close: function() {            
            // reset overflow
            //$('body').css('overflow', 'auto');
        }
    }); // end of dialog

    $("#loadingScreen").dialog('option', 'width', 42);    
});

function waitingDialog() { // I choose to allow my loading screen dialog to be customizable, you don't have to
    $("#loadingScreen").dialog('open');
}

function closeWaitingDialog() {
    $("#loadingScreen").dialog('close');
}